
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="admin" />
        <title>Create User</title>
    </head>
    <body>
		<div id="center-column">
			<div class="top-bar">
				<h1>Create User</h1>
				<div class="breadcrumbs">
					<a class="home" href="${createLinkTo(dir:'')}">Home</a> / 
					<g:link class="list" action="list">User List</g:link>
				</div>
			</div><br />
			<div class="select-bar-border-no"></div>
	        <div class="body">
	            <g:form action="save" method="post" >
	                <div class="dialog">
	                	<div class="subdialog">
                            <p class='value ${hasErrors(bean:user,field:'username','errors')}'>
                                 <label for='username'>username:</label>
                                 <input type="text" id='username' name='username' value="${user?.username?.encodeAsHTML()}"/>
                            </p>
                            <p class='value ${hasErrors(bean:user,field:'password','errors')}'>
                                 <label for='password'>password:</label>
                                 <input type="password" id='password' name='password' value="${user?.password?.encodeAsHTML()}"/>
                            </p>
                            <p class='value ${hasErrors(bean:user,field:'firstname','errors')}'>
                                 <label for='firstname'>Firstname:</label>
                                 <input type="text" id='firstname' name='firstname' value="${user?.firstname?.encodeAsHTML()}"/>
                            </p>
                            <p class='value ${hasErrors(bean:user,field:'lastname','errors')}'>
                                 <label for='lastname'>Lastname:</label>
                                 <input type="text" id='lastname' name='lastname' value="${user?.lastname?.encodeAsHTML()}"/>
                            </p>
                            <p class='value ${hasErrors(bean:address,field:'street','errors')}'>
	                            <label for='street'>Street:</label>
	                            <input type="text" id='street' name='street' value="${address?.street?.encodeAsHTML()}"/>
                            </p>
                            <p class='value ${hasErrors(bean:address,field:'zipcode','errors')}'>
                            	<label for='zipcode'>Zipcode:</label>
                            	<input type='text' id='zipcode' name='zipcode' value="${address?.zipcode}" />
                            </p>                            
                            <p class='value ${hasErrors(bean:address,field:'city','errors')}'>
                            	<label for='city'>City:</label>
                            	<input type="text" id='city' name='city' value="${address?.city?.encodeAsHTML()}"/>
                            </p>
	                	</div>                        
	                </div>
	                <div class="buttons">
	                    <span class="button"><input class="save" type="submit" value="Create"></input></span>
	                </div>
	            </g:form>
	    	</div>
        </div>
		<div id="right-column">
            <g:if test="${flash.message}">
				<strong class="h">INFO</strong>
	            <div class="box">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${user}">
				<strong class="h">ERROR</strong>
                <div class="box"><g:renderErrors bean="${user}" as="list" /></div>
            </g:hasErrors>
		</div>
    </body>
</html>
